﻿<%@ Page Title="Title" Language="C#" Inherits="System.Web.Mvc.ViewPage<object>" MasterPageFile="~/Views/Shared/Site.Master" %>

<asp:Content runat="server" ID="Title" ContentPlaceHolderID="TitleContent">
</asp:Content>
<asp:Content runat="server" ID="Main" ContentPlaceHolderID="MainContent">
    <h1>
        ASP.net Project Awesome Store</h1>
    <script type="text/javascript">
        $(function () {
            $('#b1').click(function () {
                if ($('#agree').is(':checked'))
                    $('#f1').submit();
                else
                alert('Please check the box next to "I have read and agreed to the License Agreement" in order to proceed with your purchase');
            });
           
            $('.pq').keypress(function (event) {
                // Backspace, tab, enter, end, home, left, right
                // We don't support the del key in Opera because del == . == 46.
                var controlKeys = [8, 9, 13, 35, 36, 37, 39];
                // IE doesn't support indexOf
                var isControlKey = controlKeys.join(",").match(new RegExp(event.which));
                // Some browsers just don't raise events for control keys. Easy.
                // e.g. Safari backspace.
                if (!event.which || // Control keys in most browsers. e.g. Firefox tab is 0
      (49 <= event.which && event.which <= 57) || // Always 1 through 9
      (48 == event.which && $(this).attr("value")) || // No 0 first digit
      isControlKey) { // Opera assigns values for control keys.
                    return;
                } else {
                    event.preventDefault();
                }
            });
        });
    </script>
    <br />
    <div>
        <div class="ptitle">
            <div>
                <span class="awfl"></span>
            </div>
            <div>
                ASP.net Project Awesome jQuery Ajax Controls version 1.0, developer license
            </div>
        </div>
        <div class="price">
            Price: 179$
        </div>
        <div>
            jQuery Ajax Controls for <b>ASP.NET Web-Forms</b><br />
            ASP.net Project Awesome provides developers with flexible, advanced controls to
            rapidly build highly responsive and interactive Ajax-enabled Web applications.
        </div>
        <div>
            <div class="efield">
                <div class="einput">
                    <input type="checkbox" name='agree' id='agree' />
                    <label for="agree">
                        I have read and agreed to the <a href="<%=Url.Action("License") %>" target="blank">License
                            Agreement</a>
                    </label>
                </div>
            </div>
            <%if (Request.IsAuthenticated)
              {%>
            <form method="post" action="http://sites.fastspring.com/awesomec/api/order" class="ib" id="f1">
             <%}
              else
              {%>
            <form method="get" action="<%=Url.Action("LogIn","account") %>" class="ib" id="f1">
            <input type="hidden" value="buy" name="reason" />
            <input type="hidden" name="returnUrl" value="<%=Html.ViewContext.HttpContext.Request.Url.PathAndQuery %>" />
             <%}%>
            <input type="hidden" name="operation" value="create" />
            <input type="hidden" name="destination" value="contents" />
            <input type="hidden" name="referrer" value="<%=User.Identity.Name %>" />
            <input type="hidden" name="product_1_path" value="/aspnetprojectawesomejqueryajaxcontrols" />
            <input type="hidden" name="mode" value="test" />

            <label class="bc" for="p1q">
                License count:</label>
            <input id="p1q" type="text" name="product_1_quantity" value="1" class="bc pq" />
            </form>           
            <input type="submit" value="Buy Now" class="bc" id="b1" />                   
        </div>
    </div>
</asp:Content>
